'use strict';
module.exports = {
	/**
	 * 获取用户做题记录
	 * @url client/quest-bank/kh/getMyInfo 前端调用的url参数地址
	 * data 请求参数
	 * @param {String} params1  参数1
	 */
	main: async (event) => {
		let { data = {}, userInfo, util, filterResponse, originalParam } = event;
		let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
		let { uid, cate_id } = data;
		let res = { code: 0, msg: "" };
		// 业务逻辑开始-----------------------------------------------------------

		let whereJson = { user_id: uid }
		if (cate_id != null) whereJson['cate_id'] = cate_id

		res.data = await vk.baseDao.select({
			dbName: "q_user_count",
			getMain: true,
			pageIndex: 1,
			pageSize: 9999,
			whereJson
		})

		// 业务逻辑结束-----------------------------------------------------------
		return res;
	}
}
